Conditional Printing/Processing
Introduction
Some situations require that certain fields should print (or not print) based on a specified criteria. A good example of this would be a signature limit on a purchase order. Your company policy could dictate that purchase orders less than a certain value would print a graphic image of a signature, but purchase orders above the limit would require an actual hand-written signature, thus no signature need be printed. This situation could be handled easily by using FormFusion’s Conditional Print feature.
The following example uses a PO where a signature is printed on the PO if the total is less than $200. Page one of the output for this example contains a PO with a total of $195.50, and page two has a total of $285 (shown in the image below). The image of the signature will print on page one, but the field will be left blank on page two.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The PO form shown in the figure above was developed within FormStamp and contains the graphic image of the signature. This is the object that requires print conditions.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The MapForm image below shows the "Total" field that will be used as the criteria for printing the signature.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The CaptureForm query is written, which, based upon the value of the Total field sets the printsignature variable to “not NULL” or leaves the variable in a NULL state. Note that printsignature is set to NULL if the total is greater than 200, and “not NULL” if the value of Total is less than or equal to 200. FormFusion will check if the value is “null” or “not NULL”, so although ‘true’ was utilized, any string that is not NULL could have been used.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
Next, open FormStamp then bring up the Object Properties dialog for the signature object by right clicking on the object then selecting Format Object. For this example, the object is a graphic image of a signature. The following dialog will then be displayed:
Select the printsignature variable, which determines if the object (the signature in this case) will print. If printsignature is not a null value, FormFusion will print the signature.
This completes the process. The output will now print as shown on the next page.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
This example has demonstrated conditional printing of an object based on the value of a field. You can also conditionally print any object on a FormStamp by editing its properties.
Conditional printing can also be applied to an entire form. To accomplish this, open the FormStamp and right click anywhere in the Design Window and go to Form Properties. In the FormStamp Properties dialog, go to the Overlay tab. You can then select a variable to be used to determine if the form will be printed. Note that the default is <always print>.